import 'package:find_friend/const/const.dart';
import 'package:flutter/material.dart';

class MineSettingListView extends StatelessWidget {

  final List<String> list = [
    "我的星域",
    "弹幕管理",
    "我的抵用券",
    "黑匣子",
    "商城",
    "安利找他",
    "系统设置"
  ];

  List<Widget> _create(BuildContext context) {
    List<Widget> temp = [];
    list.forEach((element) {
      Widget wid = Container(
        padding: const EdgeInsets.only(left: 15, right: 15, bottom: 15),
        child: GestureDetector(
          behavior: HitTestBehavior.opaque,
          onTap: (){
            int index = list.indexOf(element);
            switch (index) {
              case 0:
                Navigator.of(context).pushNamed("/userfollow");
                break;
              case 1:
                Navigator.of(context).pushNamed("/usermessage");
                break;
              case 2:
                // Navigator.of(context).pushNamed("/usermessage");
              break;
              case 3:
                Navigator.of(context).pushNamed("/userblack");
              break;
              case 4://商城
                // Navigator.of(context).pushNamed("/userblack");
              break;
              case 5://商城
                Navigator.of(context).pushNamed("/webview",arguments: "https://www.baidu.com");
              break;
              case 6:
                Navigator.of(context).pushNamed("/usersetting");
              break;
              default:
            }
          },
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Expanded(
                child: Padding(
                  padding: const EdgeInsets.only(top:6.0),
                  child: Text(element, style: instanceTextStyle(14, APP_font_black)),
                ),
              ),
              Image.asset("assets/my-next.png")
            ],
          ),
        ),
      );
      temp.add(wid);
    });
    return temp;
  }

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: Column(
        children: _create(context),
      ),
    );
  }
}